package com.tyhy.enums;

/**
 * Deleted 枚举
 *
 * @author chenxu
 * @since 2019年11月08日
 */
public enum DeletedEnum {
    /**
     * 已删除
     */
    DELETED(1,"已删除"),
    /**
     * 未删除
     */
    UNDELETED(0,"未删除");

    private Integer code;
    private String name;
    DeletedEnum(Integer code, String name){
        this.code = code;
        this.name = name;
    }

    public static String getName(String code){
        for (DeletedEnum obj : DeletedEnum.values()) {
            if(obj.getCode().equals(code)){
                return obj.getName();
            }
        }
        return "";
    }

    public String getName() {
        return name;
    }

    public Integer getCode() {
        return code;
    }
}
